#coding = utf-8
import socket
import sys
reload(sys)
sys.setdefaultencoding('utf8')


host = '127.0.0.1'
mport = input('my port:')
yport = input('your port:')

udpsock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

udpsock.bind((host,mport))

print 'wait for others words'
while True:
    data,addr=udpsock.recvfrom(1024)
    print data
    words = raw_input("mywords:")
    udpsock.sendto(words,(host, yport))
    
    

